package org.ant.gui.panes;

import java.awt.Color;
import java.awt.ScrollPane;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.BorderFactory;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;

import org.ant.ctrl.CodesManager;

public class AssTabbedPane extends JTabbedPane implements ActionListener {

	private StatPane statPane;
	private TACPane tacPane;

	public AssTabbedPane() {
		super();
		init();
		loadComponents();
	}

	protected void init() {

	}

	protected void loadComponents() {
		addTab(StatPane.NAME, new JScrollPane(getStatPane()));
		addTab(TACPane.NAME, new JScrollPane(getTACPane()));
	}

	public StatPane getStatPane() {
		if (statPane == null) {
			statPane = new StatPane();
		}
		return statPane;
	}

	public TACPane getTACPane() {
		if (tacPane == null) {
			tacPane = new TACPane();
		}
		return tacPane;
	}

	public void actionPerformed(ActionEvent e) {
		if (e.getSource() instanceof CodesManager) {
			getStatPane().update();
			getTACPane().update();
		}
	}

}
